<template>
  <el-form
    ref="qmGenForm"
    :model="models"
    :rules="rules"
    :disabled="disabled"
    label-width="100px"
    class="qm-gen-form"
  >
    <el-row>
      <el-col :span="12">
        <el-form-item label="编码：" prop="model.code">
          <el-input v-model="models.model.code" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="名称：" prop="model.name">
          <el-input v-model="models.model.name" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-row>
      <el-col :span="24">
        <el-form-item label="内容类型：" prop="model.contentType">
          <el-select v-model="models.model.contentType">
            <el-option label="普通文本" value="0"/>
            <el-option label="富文本" value="1"/>
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>

    <el-row v-if="models.model.contentType == 0">
      <el-col :span="24">
        <el-form-item label="内容：" prop="model.content">
          <el-input  v-model="models.model.content" type="textarea" :rows="5" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-row v-if="models.model.contentType == 1">
      <el-col :span="24">
        <el-form-item label="内容：" prop="model.content">
          <div>
          <editor v-model="models.model.content" :min-height="192" :disabled="disabled" />
          </div>
        </el-form-item>
      </el-col>
    </el-row>

    <el-row>
      <el-col :span="12">
        <el-form-item label="频率，几天一次：" prop="model.rate">
          <el-input v-model="models.model.rate" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="最大发送次数：" prop="model.maxSendTimes">
          <el-input v-model="models.model.maxSendTimes" />
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="代理类：" prop="model.proxyClass">
          <el-input v-model="models.model.proxyClass" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="扩展字段1：" prop="model.reserve1">
          <el-input v-model="models.model.reserve1" />
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="12">
        <el-form-item label="扩展字段2：" prop="model.reserve2">
          <el-input v-model="models.model.reserve2" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="扩展字段3：" prop="model.reserve3">
          <el-input v-model="models.model.reserve3" />
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import Editor from "@/components/Editor";
export default {
  name: 'MessageSysMessageTemplateCreate',
  components: {
    Editor
  },
  props: {
    models: Object,
    controlData: Object,
    disabled: Boolean
  },
  data() {
    return {
      rules: {
        'model.code': [
          {
            required: true,
            message: '这是必填字段',
            trigger: 'blur'
          }
        ],
        'model.name': [
          {
            required: true,
            message: '这是必填字段',
            trigger: 'blur'
          }
        ],
        'model.content': [
          {
            required: true,
            message: '这是必填字段',
            trigger: 'blur'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

<style scoped></style>
